#pragma once

#include "MBDataTypes.h"
#include "MBVec4.h"

// GLM
#define GLM_PRECISION_HIGHP_FLOAT
#include <glm/glm.hpp>

/**
  *	An MBMatrix4x4 is a conventional 4x4 matrix consisting of double values
  */
class MBMatrix4x4
{
public:
	MBMatrix4x4( const double &diagonalElem = 1.0 );
	MBMatrix4x4( const double *values );
	MBMatrix4x4( const double &v11, const double &v12, const double &v13, const double &v14, 
				 const double &v21, const double &v22, const double &v23, const double &v24, 
				 const double &v31, const double &v32, const double &v33, const double &v34, 
				 const double &v41, const double &v42, const double &v43, const double &v44 );
	
	double &At( const MBuint &row, const MBuint &col );
	const double &At( const MBuint &row, const MBuint &col ) const;
	MBMatrix4x4 GetInverse( void ) const;
	MBMatrix4x4 GetTranspose( void ) const;
	MBMatrix4x4 operator*( const MBMatrix4x4 &other ) const;
	MBVec4 operator*( const MBVec4 &vec ) const;

	void Print( void ) const;

	static MBMatrix4x4 RotationXYZ( const double &rotX, const double &rotY, const double &rotZ );
	static MBMatrix4x4 TranslationXYZ( const double &transX, const double &transY, const double &transZ );

private:
	MBMatrix4x4( const glm::mat4 &matrix );

	/** The GLM matrix the MBMatrix4x4 object uses as internal data structure to store the values */
	glm::mat4 mMatrix;
};